package com.woniuxy.portal.controller;

import com.woniuxy.portal.model.entity.BookType;
import com.woniuxy.portal.service.BookTypeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/bookType")
public class BookTypeController {
    @Autowired
    private BookTypeService bookTypeService;

    @GetMapping("/findAll")
    @ApiOperation("查询所有书籍分类")
    public ResponseEntity<List<BookType>> findAll() {
        List<BookType> types = bookTypeService.findAll();
        return ResponseEntity.ok(types);
    }
}